<template>
  <view class="card">
    <navigator
      :url="`/pages/search/particulars/index?id=${data.id}`"
      open-type="navigate"
      hover-class="navigator-hover"
    >
      <view class="image-section">
        <image
          class="profile-image"
          :src="data.avatar"
          mode="aspectFill"
        />
        <!-- :src="data.avatar" -->
      </view>
      <view class="details-section">
        <view class="name-section">
          <view class="name-image">
            <text class="name">{{ data.nickname }}</text>
            <image src="../../../static/images/boy.png" alt="" />
          </view>
          <view class="name-desc">{{ data.marriage_timing }}</view>
        </view>
        <view class="info-desc">
          <view class="info-section">
            <text class="info">{{ data.age }}岁</text>
            <text class="info">{{ data.height }}cm</text>
            <text class="info">{{ data.education }}</text>
            <text class="info">{{ data.monthly_income }}</text>
          </view>
          <view class="location-section">
            <image src="../../../static/images/address.png" class="location-icon" />
            <text class="location">{{ data.household_region }}</text>
          </view>
        </view>

        <text class="description">{{ data.self_introduction }}</text>
      </view>

      <text class="description">我是天喝座，敢爱敢恨，我是一个真诚，值得信赖的人</text>
    </navigator>
  </view>
</template>

<script setup lang="ts">
import { defineProps } from 'vue'
const props = defineProps({
  data: {
    type: Array as any,
    default: () => [],
  },
})
console.log(props.data)
</script>

<style lang="scss" scoped>
.card {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
  margin: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.image-section {
  position: relative;
  width: 100%;
  height: 800rpx;
}

.profile-image {
  width: 100%;
  height: 100%;
}

.verified-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: red;
  color: white;
  padding: 2px 5px;
  font-size: 12px;
  border-radius: 3px;
  z-index: 2;
}

.icon {
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 5px;
  margin-bottom: 5px;
  border-radius: 50%;
  font-size: 14px;
  text-align: center;
  width: 24px;
  height: 24px;
}

.details-section {
  padding: 16px;
  .name-image {
    display: flex;
    .name {
      font-size: 20px;
      margin-right: 8px;
    }
  }
  .name-section {
    display: flex;
    justify-content: space-between;
    image {
      margin-top: 5px;
      width: 20px;
      height: 20px;
    }
  }

  .name-desc {
    color: #999999;
  }
}

.info-desc {
  display: flex;
  justify-content: space-between;
}

.gender-icon {
  font-size: 18px;
}

.info-section {
  color: #666666;
  display: flex;
  justify-content: space-around;
  margin: 10px 0;
}

.info {
  background-color: #f0f0f0;
  padding: 4px 9px;
  border-radius: 15px;
  font-size: 14px;
  margin-right: 5px;
}

.location-section {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}

.location-icon {
  width: 16px;
  height: 16px;
  margin-right: 4px;
}

.location {
  color: #666;
}

.description {
  text-align: center;
  color: #666;
  font-size: 14px;
}
</style>
